<?php

/**
 * ProductDetailField form base class.
 *
 * @method ProductDetailField getObject() Returns the current form's model object
 *
 * @package    Onnobostro
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseProductDetailFieldForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'         => new sfWidgetFormInputHidden(),
      'product_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Product'), 'add_empty' => false)),
      'size_id'    => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('ProductSize'), 'add_empty' => false)),
      'name'       => new sfWidgetFormChoice(array('choices' => array('A:Body Length' => 'A:Body Length', 'B:Half Chest Width' => 'B:Half Chest Width', 'C:Sleeve Length' => 'C:Sleeve Length', 'D:Shoulder to Shoulder' => 'D:Shoulder to Shoulder', 'E:Collar Opening' => 'E:Collar Opening', 'F:Cuff/Sleeve Opening' => 'F:Cuff/Sleeve Opening', 'F:Sleeve Opening' => 'F:Sleeve Opening', 'B:Half Chest Width Upper' => 'B:Half Chest Width Upper', 'F:Half Chest (Lower)' => 'F:Half Chest (Lower)', 'A:Length' => 'A:Length', 'B:Waist (Normal)' => 'B:Waist (Normal)', 'C:Stretched Waist' => 'C:Stretched Waist', 'D:Half Width at Upper' => 'D:Half Width at Upper', 'E:Bottom Opening' => 'E:Bottom Opening', 'A:Waist Opening' => 'A:Waist Opening', 'B:Length' => 'B:Length', 'C:Thigh' => 'C:Thigh', 'D:Bottom Open' => 'D:Bottom Open', 'E:Height at Crotch' => 'E:Height at Crotch'))),
      'value'      => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'id'         => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'product_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Product'))),
      'size_id'    => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('ProductSize'))),
      'name'       => new sfValidatorChoice(array('choices' => array(0 => 'A:Body Length', 1 => 'B:Half Chest Width', 2 => 'C:Sleeve Length', 3 => 'D:Shoulder to Shoulder', 4 => 'E:Collar Opening', 5 => 'F:Cuff/Sleeve Opening', 6 => 'F:Sleeve Opening', 7 => 'B:Half Chest Width Upper', 8 => 'F:Half Chest (Lower)', 9 => 'A:Length', 10 => 'B:Waist (Normal)', 11 => 'C:Stretched Waist', 12 => 'D:Half Width at Upper', 13 => 'E:Bottom Opening', 14 => 'A:Waist Opening', 15 => 'B:Length', 16 => 'C:Thigh', 17 => 'D:Bottom Open', 18 => 'E:Height at Crotch'), 'required' => false)),
      'value'      => new sfValidatorString(array('max_length' => 100)),
    ));

    $this->widgetSchema->setNameFormat('product_detail_field[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'ProductDetailField';
  }

}
